package com.sl.au.repository;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import com.sl.au.entity.UserEventTypeBindInfo;

public interface UserEventTypeBindInfoRepository extends JpaRepository<UserEventTypeBindInfo, String> {
	@Query("select a from UserEventTypeBindInfo a where a.user.id=?1 and a.eventType.id=?2")
	UserEventTypeBindInfo findByUserAndType(String uid, String tid);
	
	@Query("select count(a) from UserEventTypeBindInfo a where a.user.id=?1")
	int getCountByUser(String uid);

}
